home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / lex.man < prev    next >
Encoding:
Text File  |  1989-10-23  |  2.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. LEX                       User Commands                       LEX
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      lex - generator of lexical analysis programs
  10.  
  11. SSYYNNOOPPSSIISS
  12.      lleexx [ --ttvvffnn ] [ file ] ...
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      _L_e_x generates programs to be used in simple lexical analyis
  16.      of text.  The input _f_i_l_e_s (standard input default) contain
  17.      regular expressions to be searched for, and actions written
  18.      in C to be executed when expressions are found.
  19.  
  20.      A C source program, 'lex.yy.c' is generated, to be compiled
  21.      thus:
  22.  
  23.           cc lex.yy.c -ll
  24.  
  25.      This program, when run, copies unrecognized portions of the
  26.      input to the output, and executes the associated C action
  27.      for each regular expression that is recognized.
  28.  
  29.      The options have the following meanings.
  30.  
  31.      --tt   Place the result on the standard output instead of in
  32.           file "lex.yy.c".
  33.  
  34.      --vv   Print a one-line summary of statistics of the generated
  35.           analyzer.
  36.  
  37.      --nn   Opposite of --vv; --nn is default.
  38.  
  39.      --ff   "Faster" compilation: don't bother to pack the result-
  40.           ing tables; limited to small programs.
  41.  
  42. EEXXAAMMPPLLEE
  43.           lex lexcommands
  44.  
  45.      would draw _l_e_x instructions from the file _l_e_x_c_o_m_m_a_n_d_s, and
  46.      place the output in _l_e_x._y_y._c
  47.  
  48.  
  49.           %%
  50.           [A-Z] putchar(yytext[0]+'a'-'A');
  51.           [ ]+$ ;
  52.           [ ]+  putchar(' ');
  53.  
  54.      is an example of a _l_e_x program that would be put into a _l_e_x
  55.      command file.  This program converts upper case to lower,
  56.      removes blanks at the end of lines, and replaces multiple
  57.      blanks by single blanks.
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0              April 14, 1986                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LEX                       User Commands                       LEX
  71.  
  72.  
  73.  
  74. SSEEEE AALLSSOO
  75.      yacc(1), sed(1)
  76.      M. E. Lesk and E. Schmidt, _L_E_X - _L_e_x_i_c_a_l _A_n_a_l_y_z_e_r _G_e_n_e_r_a_t_o_r
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              April 14, 1986                         2
  130.  
  131.  
  132.  
  133.